//
//  XXColorExtention.swift
//  OfferManager
//
//  Created by IT.Bear on 2018/1/4.
//  Copyright © 2018年 OFFER. All rights reserved.
//

import Foundation
import UIKit


extension UIColor {
    class func rgbaColorFromHex(rgb:Int, alpha:CGFloat) ->UIColor {
        
        return UIColor(red: ((CGFloat)((rgb & 0xFF0000)>>16))/255.0,
                       green: ((CGFloat)((rgb & 0xFF00)>>8))/255.0,
                       blue: ((CGFloat)(rgb & 0xFF)) / 255.0,
                       alpha: alpha)
    }
    
    /**
     *  16进制 转 RGB
     */
    class func rgbColorFromHex(rgb:Int) ->UIColor {
        
        return UIColor(red: ((CGFloat)((rgb & 0xFF0000)>>16))/255.0,
                       green: ((CGFloat)((rgb & 0xFF00)>>8))/255.0,
                       blue: ((CGFloat)(rgb & 0xFF)) / 255.0,
                       alpha: 1.0)
    }
}
